#include <cstdio>
#include <cstring>

class big_integer{
public:
    int digit[1000];
    int size;
    void init(){
        for (int i = 0; i < 1000; i++)
            digit[i] = 0;
        size = 0;
    }
    void set(int x){
        init();
        do {
            digit[size++] = x % 10000;
            x /= 10000;
        } while (x != 0);
    }
    void output(){
        for (int i = size - 1; i >= 0; i--){
            if (i != size - 1)
                printf("%04d", digit[i]);
            else
                printf("%d", digit[i]);
        }
        printf("\n");
    }
    big_integer operator * (int x) const{
        big_integer return_num;
        return_num.init();
        int carry = 0;
        for (int i = 0; i < size; i++){
            int temp_num = x * digit[i] + carry;
            carry = temp_num / 10000;
            temp_num %= 10000;
            return_num.digit[return_num.size++] = temp_num;
        }
        if (carry != 0)
            return_num.digit[return_num.size++] = carry;
        return return_num;
    }
} num_a;

int main(int argc, char const *argv[]){
    int n;
    while(scanf("%d", &n) != EOF){
        num_a.init();
        num_a.set(1);
        for (int i = 1; i <= n; i++)
            num_a = num_a * i;
        num_a.output();
    }
    return 0;
}
